package com.base.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 定时任务表
 * @TableName spring_scheduled_cron
 */
@TableName(value ="spring_scheduled_cron")
@Data
public class SpringScheduledCron implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer cronId;

    /**
     * 定时任务完整类名
     */
    private String cronKey;

    /**
     * cron表达式
     */
    private String cronExpression;

    /**
     * 任务描述
     */
    private String taskExplain;

    /**
     * 状态,0:正常;1:停用
     */
    private Byte status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SpringScheduledCron other = (SpringScheduledCron) that;
        return (this.getCronId() == null ? other.getCronId() == null : this.getCronId().equals(other.getCronId()))
            && (this.getCronKey() == null ? other.getCronKey() == null : this.getCronKey().equals(other.getCronKey()))
            && (this.getCronExpression() == null ? other.getCronExpression() == null : this.getCronExpression().equals(other.getCronExpression()))
            && (this.getTaskExplain() == null ? other.getTaskExplain() == null : this.getTaskExplain().equals(other.getTaskExplain()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCronId() == null) ? 0 : getCronId().hashCode());
        result = prime * result + ((getCronKey() == null) ? 0 : getCronKey().hashCode());
        result = prime * result + ((getCronExpression() == null) ? 0 : getCronExpression().hashCode());
        result = prime * result + ((getTaskExplain() == null) ? 0 : getTaskExplain().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", cronId=").append(cronId);
        sb.append(", cronKey=").append(cronKey);
        sb.append(", cronExpression=").append(cronExpression);
        sb.append(", taskExplain=").append(taskExplain);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}